<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const readline = require('readline'
                var fn = function() {
                    let arr = readLine().split(' ').map(Number);
                    let n = arr[0]
                    let x = arr[1]
                    let c = arr[2]
                    let arr1 = readLine().split(' ').map(Number);
                    var count;
                    for (let i = 0; i < n; i++) {
                        if (arr1[i] > c && Math.abs(arr1[i] - x) <= 3) {
                            count++;
                        }
                    }
                    console.log('count', count);
                }
                fn();
    </script>
</body>

</html>